//
//  FLMManageOrderDetailCell.m
//  FLMSuperS
//
//  Created by xiaoyang on 16/9/15.
//  Copyright © 2016年 FaLaoMiaoNetworkTechnologyCo. All rights reserved.
//

#import "FLMManageOrderDetailCell.h"

@interface FLMManageOrderDetailCell()
@property (nonatomic,strong) UILabel *titleLb, *subTitleLb;
@property (nonatomic,strong) UILabel *contentLb;
@end

@implementation FLMManageOrderDetailCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self layoutUI];
    }
    
    return self;
}

- (void)layoutUI
{
    if (!_titleLb) {
        _titleLb = [[UILabel alloc]init];
        _titleLb.font = font14;
        [_titleLb setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        [self.contentView addSubview:_titleLb];
        [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(@15);
            make.top.mas_equalTo(@5);
            make.width.equalTo(@70);
        }];
    }
    
    if (!_subTitleLb) {
        _subTitleLb = [[UILabel alloc]init];
        _subTitleLb.font = font10;
        [self.contentView addSubview:_subTitleLb];
        [_subTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(@15);
            make.top.mas_equalTo(_titleLb.mas_bottom).offset(2);
            make.bottom.equalTo(@-5);
        }];
    }
    
    if (!_contentLb) {
        _contentLb = [[UILabel alloc]init];
        _contentLb.font = font14;
        [self.contentView addSubview:_contentLb];
        [_contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(_titleLb.mas_right).offset(5);
            make.centerY.mas_equalTo(self.contentView);
            make.right.mas_equalTo(@-15);
        }];
    }

    
    
}

- (void)configCellWithTitle:(NSString *)title subTitle:(NSString *)subTitle content:(NSString *)content contentTextColor:(UIColor *)color contentAlig:(NSTextAlignment)alig
{
    _titleLb.text = title;
    _subTitleLb.text = subTitle;
    _contentLb.text = content;
    _contentLb.textColor =color;
    _contentLb.textAlignment = alig;
}

- (void)configClaimOrderWithContent:(NSString *)content
{
    [_titleLb mas_updateConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@40);
    }];
    
    _titleLb.text = @"订单分类";
    _contentLb.textColor = black;
    if (content.length) {
        _contentLb.text = content;
    }
}

@end
